<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=no">

    <meta name="twitter:site" content="@metroui">
    <meta name="twitter:creator" content="@pimenov_sergey">
    <meta name="twitter:card" content="summary">
    <meta name="twitter:title" content="Metro 4 Components Library">
    <meta name="twitter:description" content="Metro 4 is an open source toolkit for developing with HTML, CSS, and JS. Quickly prototype your ideas or build your entire app with responsive grid system, extensive prebuilt components, and powerful plugins  .">
    <meta name="twitter:image" content="https://metroui.org.ua/images/m4-logo-social.png">

    <meta property="og:url" content="https://metroui.org.ua/v4/index.html">
    <meta property="og:title" content="Metro 4 Components Library">
    <meta property="og:description" content="Metro 4 is an open source toolkit for developing with HTML, CSS, and JS. Quickly prototype your ideas or build your entire app with responsive grid system, extensive prebuilt components, and powerful plugins  .">
    <meta property="og:type" content="website">
    <meta property="og:image" content="https://metroui.org.ua/images/m4-logo-social.png">
    <meta property="og:image:secure_url" content="https://metroui.org.ua/images/m4-logo-social.png">
    <meta property="og:image:type" content="image/png">
    <meta property="og:image:width" content="968">
    <meta property="og:image:height" content="504">

    <meta name="author" content="Sergey Pimenov">
    <meta name="description" content="Use builtin animation for your elements with animation utilities.">
    <meta name="keywords" content="HTML, CSS, JS, Metro, CSS3, Javascript, HTML5, UI, Library, Web, Development, Framework">

    <link rel="shortcut icon" href="favicon.ico" type="image/x-icon">
    <link rel="icon" href="favicon.ico" type="image/x-icon">

    <link href="metro/css/metro-all.css?ver=@@b-version" rel="stylesheet">
    <link href="highlight/styles/github.css" rel="stylesheet">
    <link href="docsearch/docsearch.min.css" rel="stylesheet">
    <link href="css/site.css" rel="stylesheet">

    <title>Post Card Animation - Metro 4 :: Popular HTML, CSS and JS library</title>

    <style>
        .post-card {
            width: 100%;
            height: 480px;
        }
    </style>

</head>
<body class="m4-cloak">

<header data-role="html-container" data-insert-mode="replace" data-html-source="header.html"></header>

<div data-role="html-container" data-insert-mode="replace" data-html-source="sidebar-menu.html"></div>

<div class="container-fluid">

    <div class="row flex-xl-nowrap">

            <div class="d-none d-block-xl cell-xl-2 order-2 border-left bd-light toc-wrapper">
                <h5>Table of contents</h5>
                <hr/>
                <ul class="toc-nav">
                    <li class="toc-entry"><a href="#_about">About</a></li>
                    <li class="toc-entry"><a href="#_activation">Activation effect</a></li>
                    <li class="toc-entry"><a href="#_flip_orientation">Left or Right</a></li>
                </ul>
            </div>

            <main class="cell-xl-10 order-1 pr-1-sx pl-1-sx pr-5-md pl-5-md">
                <div class="place-right d-none d-block-lg" style="width: 200px;">
                    <img src="images/logo.png" class="w-100" alt="">
                </div>

                <h1>Post Card</h1>
                <p class="text-leader">
                    Use builtin animation for your object to create post card animation.
                </p>

                <!-- ads-html -->

                <h3 id="_about">About</h3>
                <p>
                    To create <code>post-card</code> animation you must create container with class <code>post-card</code> and add two inner blocks with classes <code>.left</code> and <code>.right</code>.
                    Also you must define size for <code>post-card</code>: <code>height</code> and <code>width</code>
                </p>
                <pre><code class="html">
                    &lt;div class="post-card" style="height: 340px; width: 480px"&gt;
                        &lt;div class="left"&gt;&lt;/div&gt;
                        &lt;div class="right"&gt;&lt;/div&gt;
                    &lt;/div&gt;
                </code></pre>
                <div class="example">
                    <div class="text-center">
                        <button class="button" onclick="$('.post-card').toggleClass('active')">Flip the cards</button>
                    </div>
                    <div class="row mt-4" style="height: 600px;">
                        <div class="cell-lg-6 bg-dark d-flex flex-justify-center flex-align-center">
                            <div class="post-card effect-on-active rotate-to-left">
                                <div class="left">
                                    <div class="h-100 bg-white d-flex flex-align-center flex-justify-center">
                                        <img src="https://picsum.photos/id/1005/300/600">
                                    </div>
                                </div>

                                <div class="right">
                                    <div class="h-100 bg-white d-flex flex-align-center flex-justify-center flex-column p-6">
                                        <div class="bg-gray border-50 fg-white text-center" style="width: 64px; height: 64px;">
                                            <span class="mif-user mif-4x"></span>
                                        </div>
                                        <br>
                                        <form>
                                            <input type="text" data-role="input" data-prepend="<span class='mif-envelop'>" placeholder="Enter email">
                                            <input type="password" data-role="input" data-prepend="<span class='mif-lock'>" class="mt-2" placeholder="Enter password">
                                            <hr/>
                                            <div class="form-actions">
                                                <button class="button info" type="submit">Submit</button>
                                            </div>
                                        </form>
                                    </div>
                                </div>
                            </div>
                        </div>

                        <div class="cell-lg-6 bg-dark d-flex flex-justify-center flex-align-center">
                            <div class="post-card effect-on-active">
                                <div class="left">
                                    <div class="h-100 bg-white d-flex flex-align-center flex-justify-center flex-column p-6">
                                        <div class="bg-gray border-50 fg-white text-center" style="width: 64px; height: 64px;">
                                            <span class="mif-user mif-4x"></span>
                                        </div>
                                        <br>
                                        <form>
                                            <input type="text" data-role="input" data-prepend="<span class='mif-envelop'>" placeholder="Enter email">
                                            <input type="password" data-role="input" data-prepend="<span class='mif-lock'>" class="mt-2" placeholder="Enter password">
                                            <hr/>
                                            <div class="form-actions">
                                                <button class="button info" type="submit">Submit</button>
                                            </div>
                                        </form>
                                    </div>
                                </div>

                                <div class="right">
                                    <div class="h-100 bg-white d-flex flex-align-center flex-justify-center">
                                        <img src="https://picsum.photos/id/1005/300/600">
                                    </div>
                                </div>
                            </div>
                        </div>
                    </div>
                </div>

                <h3 id="_activation">Activation effect</h3>
                <p>
                    To activation <code>post-card</code> effect, you must add one of two subclasses:
                </p>
                <ul>
                    <li><code>.effect-on-hover</code> - card rotated on user hover cursor on the card</li>
                    <li><code>.effect-on-active</code> - card rotated on toggle class <code>.active</code> on card</li>
                </ul>

                <h4>effect-on-hover</h4>
                <pre><code class="html">
                    &lt;div class="post-card effect-on-hover"&gt;
                        &lt;div class="left"&gt;&lt;/div&gt;
                        &lt;div class="right"&gt;&lt;/div&gt;
                    &lt;/div&gt;
                </code></pre>

                <h4>effect-on-active</h4>
                <pre><code class="html">
                    &lt;div class="post-card effect-on-active"&gt;
                        &lt;div class="left"&gt;&lt;/div&gt;
                        &lt;div class="right"&gt;&lt;/div&gt;
                    &lt;/div&gt;
                </code></pre>

                <h3 id="_flip_orientation">Left or Right</h3>
                <p>
                    By default, card rotated to right side. To rotate card to left side, add subclass <code>.rotate-to-left</code> to card.
                </p>
                <pre><code class="html">
                    &lt;div class="post-card effect-on-hover rotate-to-left"&gt;
                        &lt;div class="front"&gt;&lt;/div&gt;
                        &lt;div class="back"&gt;&lt;/div&gt;
                    &lt;/div&gt;
                </code></pre>

            </main>
        </div>

    </div>

    <script src="docsearch/docsearch.min.js"></script>


    <script src="metro/js/metro.js?ver=@@b-version"></script>
    <script src="highlight/highlight.pack.js"></script>
    <script src="js/clipboard.min.js"></script>
    <script src="js/site.js"></script>
    <!-- ads-script -->
    <!-- ga-script -->
    <!-- hit-ua -->
</body>
</html>